From 0f49944534619361340a43b2020bcfa3d99430b0 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Thu, 19 Sep 2013 19:45:29 +0000 Subject: [PATCH] Guilhem Bonnefile tweaks (old) Magellan Explorist PMGNCMD,END issues. --- gpsbabel/magproto.cc | 11 ++++++++++- gpsbabel/reference/magxfile | 19 +++++++++++++++++++ gpsbabel/reference/route/magexplorist.rte | 1 + gpsbabel/testo.d/magellan.test | 4 ++-- 4 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 gpsbabel/reference/magxfile diff --git a/gpsbabel/magproto.cc b/gpsbabel/magproto.cc index a1e1b5f2c..1cd64e772 100644 --- a/gpsbabel/magproto.cc +++ b/gpsbabel/magproto.cc @@ -912,6 +912,15 @@ mag_deinit(void) trk_head = NULL; } +static void +mag_wr_deinit(void) +{ + if (explorist) { + mag_writemsg("PMGNCMD,END"); + } + mag_deinit(); +} + /* * I'm tired of arguing with scanf about optional fields . Detokenize * an incoming string that may contain empty fields. @@ -1671,7 +1680,7 @@ ff_vecs_t magX_fvecs = { magX_rd_init, magX_wr_init, mag_deinit, - mag_deinit, + mag_wr_deinit, mag_read, mag_write, NULL, diff --git a/gpsbabel/reference/magxfile b/gpsbabel/reference/magxfile new file mode 100644 index 000000000..f9ea738d8 --- /dev/null +++ b/gpsbabel/reference/magxfile @@ -0,0 +1,19 @@ +$PMGNWPL,2805.200,N,08246.200,W,0000000,M,AL7394,872 6833 A TIDAL,a*43 +$PMGNWPL,2806.216,N,08246.733,W,0000000,M,AL7485,872 6853 TIDAL 1,a*33 +$PMGNWPL,2806.216,N,08246.733,W,0000000,M,AL7484,872 6853 TIDAL 2,a*31 +$PMGNWPL,2806.050,N,08246.367,W,0000000,M,AL7482,872 6853 TIDAL 4,a*34 +$PMGNWPL,2808.816,N,08245.483,W,0000000,M,AL7471,872 6892 TIDAL 1,a*3A +$PMGNWPL,2808.816,N,08245.483,W,0000000,M,AL7470,872 6892 TIDAL 2,a*38 +$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7380,872 6899 TIDAL 1,a*35 +$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7379,872 6899 TIDAL 2,a*30 +$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7378,872 6899 TIDAL 3,a*30 +$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7377,872 6899 TIDAL 4,a*38 +$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7376,872 6899 TIDAL 5,a*38 +$PMGNWPL,2809.216,N,08248.033,W,0000000,M,AL7386,872 6904 TIDAL 1,a*32 +$PMGNWPL,2809.216,N,08248.033,W,0000000,M,AL7385,872 6904 TIDAL 2,a*32 +$PMGNWPL,2809.216,N,08248.033,W,0000000,M,AL7384,872 6904 TIDAL 3,a*32 +$PMGNWPL,2809.216,N,08248.017,W,0000000,M,AL7383,872 6904 TIDAL 4,a*34 +$PMGNWPL,2809.216,N,08248.017,W,0000000,M,AL7382,872 6904 TIDAL 5,a*34 +$PMGNWPL,2809.617,N,08245.933,W,0000000,M,AL6625,872 6905 TIDAL 5,a*3B +$PMGNWPL,2809.383,N,08244.666,W,0000000,M,AL7392,872 6906 TIDAL 2,a*31 +$PMGNCMD,END*3D diff --git a/gpsbabel/reference/route/magexplorist.rte b/gpsbabel/reference/route/magexplorist.rte index 0ca044eda..fe141c1ef 100644 --- a/gpsbabel/reference/route/magexplorist.rte +++ b/gpsbabel/reference/route/magexplorist.rte @@ -4,3 +4,4 @@ $PMGNWPL,3401.816,N,11751.349,W,0000226,M,WPT008,,a*2F $PMGNWPL,3405.686,N,11751.836,W,0000201,M,WPT009,,a*2B $PMGNRTE,2,1,c,1,Route 1,WPT006,a,WPT007,a*63 $PMGNRTE,2,2,c,1,Route 1,WPT008,a,WPT009,a*60 +$PMGNCMD,END*3D diff --git a/gpsbabel/testo.d/magellan.test b/gpsbabel/testo.d/magellan.test index 582013991..b76fa4e32 100644 --- a/gpsbabel/testo.d/magellan.test +++ b/gpsbabel/testo.d/magellan.test @@ -10,8 +10,8 @@ compare ${TMPDIR}/magfile ${REFERENCE}/magfile # Magellanx is just like, but with longer names. (which this admittedly # doesn't actually exercise...) # -gpsbabel -i magellan -f ${REFERENCE}/magfile -o magellanx -F ${TMPDIR}/magfile2 -compare ${TMPDIR}/magfile2 ${REFERENCE}/magfile +gpsbabel -i magellan -f ${REFERENCE}/magxfile -o magellanx -F ${TMPDIR}/magxfile +compare ${TMPDIR}/magxfile ${REFERENCE}/magxfile # Magellanx routes, however, have an extra 'name' field in them. gpsbabel -r -i magellanx -f ${REFERENCE}/route/magexplorist.rte -o magellanx -F ${TMPDIR}/magxfile.rte -- 2.30.2